package com.cgc.venus.server.core.bean.page;


/**
 * 分页查询对象
 */
public class PageQuery implements java.io.Serializable {
    private static final long serialVersionUID = -8000900575354501298L;

    public static final int DEFAULT_PAGE_SIZE = 10;

    public static final int MAX_PAGE_SIZE = 50;

    /**
     * 当前页数
     */
    private int page;
    /**
     * 每页大小
     */
    private int pageSize = DEFAULT_PAGE_SIZE;

    /**
     * 排序的多个列,如: username desc
     */
    private String sortColumns;

    /*
    * 查询关键字体
    * */
    private String queryKey;

    public PageQuery() {
    }

    public PageQuery(int pageSize) {
        this.pageSize = pageSize;
    }

    public PageQuery(PageQuery query) {
        this.page = query.page;
        this.pageSize = query.pageSize;
    }

    public PageQuery(int page, int pageSize) {
        this.page = page;
        this.pageSize = pageSize;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        if (pageSize > MAX_PAGE_SIZE) {
            pageSize = MAX_PAGE_SIZE;
        }
        this.pageSize = pageSize;
    }


    public String getQueryKey() {
        return queryKey;
    }

    public void setQueryKey(String queryKey) {
        this.queryKey = queryKey;
    }

    public String getSortColumns() {
        return sortColumns;
    }

    public void setSortColumns(String sortColumns) {
        this.sortColumns = sortColumns;
    }
}
